import * as VueRouter from 'vue-router'
import layout from '@/layout/layout.vue'

const router = VueRouter.createRouter({
  history: VueRouter.createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '',
      name: 'contain',
      title: '首页',
      redirect: '/home',
      component: layout,
      children: [
        {
          path: '/home',
          name: 'home',
          title: '首页',
          component: () => import('@/views/home.vue')
        }, {
          path: '/contact',
          name: 'contact',
          title: '联系我们',
          component: () => import('@/views/contact.vue')
        }, {
          path: '/package',
          name: 'package',
          title: '查询包裹',
          component: () => import('@/views/package.vue')
        } , {
          path: '/calculate',
          name: 'calculate',
          title: '物流查询',
          component: () => import('@/views/calculate.vue')
        }, {
          path: '/help',
          name: 'help',
          title: '帮助中心',
          component: () => import('@/views/help.vue')
        }, {
          path: '/notice',
          name: 'notice',
          title: '公告詳情',
          component: () => import('@/views/notice.vue')
        }
      ]
    },
    {
      path: '/download',
      name: 'download',
      title: 'app下载页',
      component: () => import('@/views/download.vue')
    }
  ]
})

export default router
